<?php
namespace Admin\Controller;
use Admin\Driver\QRedis;
use Think\Controller;

 class TestController extends Controller{
	 public function test(){
	 	$redis = new QRedis();
	 	$return=$redis->set('name1',"20170626");
	 	$res=$redis->get('name1');
		dump($res);
	 }

	 public  function getSubTree($data , $depart_pid = 0 , $lev = 0) {
	 
		 static $son = array();
		 foreach($data as $key => $value) {
			 if($value['depart_id'] == $depart_pid) {
				 $value['lev'] = $lev;
				 $son[] = $value;
				 getSubTree($data , $value['depart_pid'] , $lev+1);
			 }
		 }
		 return $son;
	 }
	 public function  id_address(){
	     $client_ip = I('get.ip');
	     $ip = new \Org\Net\IpLocation('qqwry.dat');
	     $data = $ip ->getlocation($client_ip);
	     dump($data);
     }
}
?>